<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>组件实验 props 传递数据，组件联动</title>
    <script src="../dist/vue.min.js"></script>
    <link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="app">
    <input type="text" v-model="parentMessage">
    <my-component v-bind:message="parentMessage"></my-component>
</div>

</body>
<script>
    Vue.component('my-component', {
        props: ['message'],
        template: '<div>{{message}}</div>',

    });
    let app = new Vue({
        el: '#app',
        data:{
            parentMessage: ""
        }
    });
</script>
</html>
